
import { lazy } from 'react'
import { createBrowserRouter } from 'react-router-dom'
import App from './App'
import AuthGuard from './components/AuthGuard'

const HomePage = lazy(() => import('./pages/Home'))
const AboutPage = lazy(() => import('@/pages/About'))

const router = createBrowserRouter([
  {
    path: '/',
    element: <App />,
    children: [
      {
        index: true,
        element: <AuthGuard><HomePage /></AuthGuard>
      },
      {
        path: 'about',
        element: <AuthGuard><AboutPage /></AuthGuard>
      }
    ]
  }
])

export default router
